<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>个人中心-相册管理</title>
<link href="<?php echo $this->_webroot('/user/css/common.css'); ?>" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->_webroot('/user/css/content1.css'); ?>" rel="stylesheet" type="text/css" />
<script src="<?php echo $this->_webroot('/user/js/jquery-1.7.1.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo $this->_webroot('/user/js/common.js'); ?>" type="text/javascript"></script>
<style type="text/css">
th{background:#EFEFEF}
.edit span{background:#efefef;}
.search {margin:5px;}
.search input {color:#444;}
td.img img{cursor:pointer}
</style>
<style type="text/css">
.red { color:red; }
.edit span{background:#efefef;}
.search {margin:5px;}
.search input {color:#444;}
.clear {clear:both;}
td{text-align:left;}
#bgdiv { background-color:#333; position:absolute; width:965px; left:230px; top:130px; opacity:0.4; filter:alpha(opacity=40); height:1313px; z-index:960}
#category_select { width:680px; z-index:961; position:absolute; filter:alpha(opacity=95); left:400px; top:350px; background-color:#fff; height:270px}
.category_title_1 {background:#FFE1C2; color:#F67A06; padding-left:10px; line-height:25px; font-weight:bold; font-size:14px;}
.category_title_1 span {float:right; padding-right:5px; cursor:pointer;}
.ulselect {width:168px; height:200px; overflow-x:hidden; margin-bottom:10px; overflow-y:scroll; border:1px solid #efefef; float:left;}
.ulselect li {line-height:21px; padding-left:5px; cursor:pointer;width:100%;float:left;text-align:left;}
.ulselect li:hover {background:#F6A248; color:#fff;}
.ulselect li.select {background:#F6A248; color:#fff;}
.category_com {height:30px; padding-bottom:10px; line-height:30px; text-align:center;}
.attr_class { background:#FFF2E6; }
.attr_class div.div {border:2px solid #fff; padding:3px;}
.attr_class div span.left{display:block; width:150px; float:left; margin-left:10px; text-align:right; _line-height:24px;}
.attr_class div span.right{display:block; width:350px; float:left; margin-left:5px; text-align:left;}
.attr_class div span.right input {margin-left:5px;}

#picspan {width:82px; height:82px; padding:1px; border:1px solid #efefef; line-height:80px; text-align:center; display:inline-block; overflow:hidden; float:right;}
</style>

<script type="text/javascript" src="<?php echo $this->_webroot('servtools/jquery-1.3.2.min.js?v=1.3.2'); ?>"></script>
<link href="<?php echo $this->_webroot('servtools/swfupload/css/default.css'); ?>" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo $this->_webroot('servtools/swfupload/swfupload.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('servtools/swfupload/swfupload.queue.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('servtools/swfupload/fileprogress.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('servtools/swfupload/handlers.js'); ?>"></script>


 <script type="text/javascript">
		var swfu;
		window.onload = function() {
			var settings = {
				flash_url : "<?php echo $this->_webroot('servtools/swfupload/swfupload.swf'); ?>",
				upload_url: "<?php echo $this->_url('goods/swfupload');?>",
				post_params: {"<?php echo Param::read('Session.postOrGetIdName');?>" : "<?php echo $ps; ?>","gcv":"881257c8fab1044a7f6082c12fe4ee92"},
				file_size_limit : "<?php echo Param::read('upfiles.sizelimit');?> MB",
				file_types : "<?php echo Param::read('upfiles.type');?>",
				file_types_description : "images Files",
				file_upload_limit : 30,
				file_queue_limit : 30,
				file_post_name:"Filedata[]",
				custom_settings : {
					progressTarget : "fsUploadProgress",
					cancelButtonId : "btnCancel"
				},
				debug: false,

				
				button_image_url: "<?php echo $this->_webroot('user/img/choose_photo_img_1.gif'); ?>",
				button_width: "153",
				button_height: "42",
				button_placeholder_id: "spanButtonPlaceHolder",
				button_text: '',
				button_text_style: ".theFont { font-size: 12; }",
				button_text_left_padding: 5,
				button_text_top_padding: 3,
				button_window_mode : SWFUpload.WINDOW_MODE.OPAQUE,
				button_cursor : SWFUpload.CURSOR.HAND,
				
				
				file_queued_handler : fileQueued,
				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,
				upload_start_handler : uploadStart,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : uploadGoodsSuccess,
				upload_complete_handler : uploadComplete,
				queue_complete_handler : queueComplete	// Queue plugin event
			};

			swfu = new SWFUpload(settings);
			bodyonload();
	     };
	</script>
<script type="text/javascript"> 
 function introimage(id,imagepath){
	var is=$("#image_size_id").val();
	if(is==""){
		$("#image_size_id").val(id);
	}else{
		$("#image_size_id").val(is+","+id);
	}
	var imagestr="<li id='imgli'><p class='photo'><img src="+imagepath+" width='100' height='100' /></p><p><a href='javascript:;' name='"+id+"' onclick='return delIntroImg(this)'>删除</a></p></li>";
	$("#introimage").append(imagestr);

}

function delIntroImg(obj){
	if(!confirm('你真的要删除这张图片吗?')){
       return;
		}
	var path=$(obj).parent().parent().children(".photo").children("img").attr("src");
	var is=$("#image_size_id").val();
	var iid=$(obj).attr('name');
	if(is==""){
		return;
	}
    var param={
          iid:iid,
          path:path
    	  };
    $.post("<?php echo $this->_url('goods/swfdelimage');?>",param,function(data){
        if(data=='1'){
            	var is=$("#image_size_id").val();
          		var myArray=is.split(",");
          		var a;
          		for(i=0;i<myArray.length;i++){
                      if(myArray[i]==iid){
                      	a=i;
                      	break;
                        }
          		}
          		myArray.splice(a,1);
          		var isid=myArray.join(",");
          		$("#image_size_id").val(isid);
          		$(obj).parent().parent().remove();
             }else{
                alert('删除失败');
                 }
        });
}

function AddContentImg(ImgName,classId){
	var obj = document.getElementById("goods_intro").previousSibling.children[0];
	obj.innerHTML = obj.innerHTML + "<br><IMG src='./"+ImgName+"' /><br>";
}

function bodyonload() {

}
</script>
 
 <style>


textright {
   text-align : right;
}
.index_tab {
    margin-top: 10px;
}

.index_tab ul {
    clear: both;
    margin: 0px;
    padding: 0px;
}
.index_tab ul li {
    float: left;
    margin-right: 3px;
    width: 100px;
    height: 30px;
    position: relative;
    list-style: none outside none;
    text-align: center;
    line-height: 30px;
}

.index_tab ul li a:hover, .index_tab ul li .current {
    background: none repeat scroll 0% 0% rgb(255, 255, 255);
    border-width: 1px 1px 0px;
    border-style: solid solid none;
    border-color: rgb(236, 236, 236) rgb(236, 236, 236) -moz-use-text-color;
    -moz-border-top-colors: none;
    -moz-border-right-colors: none;
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-image: none;
}
.index_tab ul li a {
    border-right: 1px solid rgb(236, 236, 236);
    border-width: 0px 1px 1px;
    border-style: none solid solid;
    border-color: -moz-use-text-color rgb(236, 236, 236) rgb(236, 236, 236);
    -moz-border-top-colors: none;
    -moz-border-right-colors: none;
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-image: none;
    display: block;
    height: 28px;
    padding-top: 2px;
    font-weight: bold;
    font-size: 14px;
    background: url("../images/memberlist_th_bg.gif") repeat-x scroll center top transparent;
    position: relative;
    bottom: -1px;
}
.main_right table a {
    color: rgb(247, 122, 7);
    text-decoration: underline;
}
.tab_box {
    border: 1px solid rgb(236, 236, 236);
    overflow: hidden;
    padding: 8px 10px;
    width: 690px;
    margin-top: 4px;
    text-align: left;	
}
.main_right table a {
    color: rgb(247, 122, 7);
    text-decoration: underline;
}
.main_right table textarea {
    border: 1px solid rgb(153, 153, 153);
}
.main_right table input[type="text"] {
    border: 1px solid rgb(153, 153, 153);
    padding: 3px 0px 0px 3px;
    width: 150px;
}
.main_right table span {
    color: rgb(255, 102, 0);
    font-weight: bold;
}
.imgPan {
    width: 570px;
    overflow: hidden;
}
.imgPan li {
    float: left;
    text-align: center;
}
.imgPan li .photo {
    width: 100px;
    height: 100px;
    margin-right: 10px;
    border: 1px solid rgb(204, 204, 204);
}
.imgPan li p {
    margin-bottom: 10px;
}



</style>  
</head>

<body>
<psp:tags     htmlname='user_topnav1'  iconname='usertopnav1' />
<psp:tags     htmlname='user_topsearch'  iconname='usertopsearch' />

<div class="main">
	<div class="main-left">
    	<div class="title">会员管理中心</div>
        <psp:tags     htmlname='user_menulist'  iconname='usermenulist' />
    </div>
	
    <div class="main-right">
        <!-- 公司相册 -->
		<form action="<?php echo $this->_url('album/addpost');?>" method="post"  >
    	<div class="company_introduce_div">
            <div class="company_title_div">
            	<span>上传到</span>
                <select name="ucat_id" id="ucat_id"  class="photos_select">
					<option value="0">
						选择相册
					</option>
					<?php echo  $html_shop_category;?>
				</select>				
                <span id="ucate_add"><a href="javascript:;" onclick="showinput();" class="ensure_publish">创建相册</a></span>
				<span id="ucate_span" style="display:none;">
				    <input type="text" value="" style="width:115px;" id="ucat_input"  maxlength="30"  />
				    <input type="button" value="增加" onclick="addnewucat();"  class="ensure_publish" style="width:83px;height:28px;"/>
				</span>
				<input class="submit" type="submit" name="submit" value="确认上传"  class="ensure_publish" style="width:83px;height:28px;border: 1px solid #2268B3;color: #2268B3;"/>
                
				
            </div>            
        </div>
        <div class="choose_photos_div">
		
		

								<div id="img_select2" style="width:600px;">
			                    	<div id="img_list2" class="imgPan">
										<ul id="introimage" class="clearfix">
										<?php foreach($result['result'] as $v){?>
										<li>
											<p class="photo"><img src="<?php echo  $v['img_url'] ;?>" width="100" height="100" onerror="this.src='skin/default/images/nopic.gif'"/></p>
											<p><a href='javascript:;' name='<?php echo $v["id"];?>' onclick='return delIntroImg(this)'>删除</a></p>
										</li>
										<?php }?>
										</ul>
			                    	</div>
								</div>
						        <div id="fsUploadProgress"></div>
						        <div id="divStatus"></div>
						        <div style="margin: 50px 282px 0 281px;">
							        <span id="spanButtonPlaceHolder"></span>
							        <input id="btnCancel" type="button" value="取消" onclick="swfu.cancelQueue();" disabled="disabled" style="display:none"  />
							        <input type="hidden" id="image_size_id" name="image_size_id" value="<?php echo  $imagelistid ;?>"/>
						        </div>
						        <div class="choose_photos_describe">(<span class="openvip_span">开通VIP</span>，每次可上传500张照片)</div>
						        <div class="choose_photos_describe" >(按ctrl键选择多个文件)</div>
                                <div style="height:50px;"></div>
			                <div id="display_favorite" class="tab_box" style="display:none;">
								<div id="img_select3" style="width:600px;">
			                    	<div id="img_list3" class="imgPan">
										<ul id="introimage1" class="clearfix">
										<?php foreach($result['result'] as $v){?>
										<li>
											<p class="photo"><img src="<?php echo  $v['img_url'] ;?>" width="100" height="100" onerror="this.src='skin/default/images/nopic.gif'"/></p>
											<p><a href='javascript:;' name='<?php echo $v["id"];?>' onclick='return delIntroImg(this)'>删除</a></p>
										</li>
										<?php }?>
										</ul>
			                    	</div>
								</div>
			                </div>		
		                
		

        </div>
		</form>
        <div class="upload_declare_wrap">
        	<div class="upload_declare_div1">
            	上传说明：<br />照片格式可以说jpg、jpeg、gif、png和bmp<br />爱搜货网用户上传的公开照片，还会在爱搜货网显示
            </div>
            <div class="upload_declare_div2">
            	您当前享有<?php echo $Mcount;?>M容量<br />
                <!--<img src="<?php echo $this->_webroot('user/img/schedule_img.gif');?>" width="158" height="14" />-->
                <div class="capacity1">已用容量 <?php $k = ($SHOP['count_imgsize']/(1024*1024)); echo $k;?>M</div>
                <div class="capacity2">剩余容量 <?php echo $Mcount-$k;?>M <a href="<?php echo $this->_url('album/index');?>">刷新</a></div>
            </div>
            <div class="upload_declare_div3">
            	升级VIP会员，可享更大空间!<br /><a href="<?php echo $this->_url('account/ranklist');?>">如何升级相册容量</a>
            </div>
            <div class="clear"></div>
        </div>
        <!-- 公司相册 end -->
        
        <!-- 页码 -->
    	<div class="pages_div">
             <a href="<?php echo $this->_url('shop/album/'.$SHOP['id']);?>" class="clear_text">去相册中心</a>
        </div>        
        <!-- 页码 end -->
    </div>
    <div class="clear"></div>
</div>

<div class="footer">
    <psp:tags     htmlname='user_footer_helper'  iconname='userfooterhelper' />

</div>
<script language="JavaScript" src="<?php echo $this->_webroot('servtools/ajax_client/ajax.js');?>"></script>
<script language="JavaScript">
<!--	
function showinput() {
	var ucate_add = document.getElementById("ucate_add");
	var ucate_span = document.getElementById("ucate_span");
	ucate_add.style.display = 'none';
	ucate_span.style.display = '';
}
function hideinput() {
	var ucate_add = document.getElementById("ucate_add");
	var ucate_span = document.getElementById("ucate_span");
	ucate_add.style.display = '';
	ucate_span.style.display = 'none';
}

function addnewucat() {
	var ucat_input = document.getElementById("ucat_input");
	var ucat_id = document.getElementsByName("ucat_id")[0];
	v = ucat_input.value;
	if(v=='') {
		alert("分类名称不能为空！");
		return false;
	} else {
		ajax("<?php echo $this->_url('album/getalbumcategoryadd/');?>","POST","name="+v,function(data){
			if(data!='-1') {
				var newoption = document.createElement("option");
				newoption.value = data;
				newoption.selected = 'selectes';
				newoption.innerHTML = v;
				ucat_id.appendChild(newoption);
				alert("添加成功");
			} else {
				alert("添加失败");
			}
		},'JSON');
		hideinput();
	}
}

//-->
</script>	
</body>
</html>